package com.diyunapp.xilinapp.utils;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.tencent.mm.sdk.modelbase.BaseReq;
import com.tencent.mm.sdk.modelbase.BaseResp;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
	
	private IWXAPI api;
	private static final String WX_APP_ID = "wx3d34176dc151d20a";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        api = WXAPIFactory.createWXAPI(this, WX_APP_ID, false);
        api.handleIntent(getIntent(), this);  
        super.onCreate(savedInstanceState);  
    }  
    
    @Override
    public void onReq(BaseReq arg0) {
    	
    }  
  
    @Override
    public void onResp(BaseResp resp) {
        Log.i("zhangxiaoxidebug", "resp.errCode:" + resp.errCode + ",resp.errStr:"
                + resp.errStr);  
        switch (resp.errCode) {  
        case BaseResp.ErrCode.ERR_OK:
        	Log.i("zhangxiaoxidebug", "分享成功！");
            break;  
        case BaseResp.ErrCode.ERR_USER_CANCEL:
        	Log.i("zhangxiaoxidebug", "分享取消！");
            break;  
        case BaseResp.ErrCode.ERR_AUTH_DENIED:
        	Log.i("zhangxiaoxidebug", "分享被拒绝！");
            break;  
        }  
    }  
}
